/*
 *    Copyright 2009-2023 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       https://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.ryan.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.ryan.SProvider;
import org.apache.ibatis.ryan.annotations.DynamicResultType;
import org.apache.ibatis.ryan.domain.PagedList;

public interface BaseAutoMapper {
  @DynamicResultType
  @SelectProvider(type = SProvider.class, method = "findByColName")
  <T> T findByColName(Class<T> var1, String var2, Object var3);

  @DynamicResultType(isList = true)
  @SelectProvider(type = SProvider.class, method = "findByColName")
  <T> List<T> listByColName(Class<T> var1, String var2, Object var3);

  @DynamicResultType(isList = true, paged = true)
  @SelectProvider(type = SProvider.class, method = "findByColName")
  <T> PagedList<T> pagedListByColName(Class<T> var1, String var2, Object var3);

  @DynamicResultType
  @SelectProvider(type = SProvider.class, method = "select")
  <T> T selectOne(Class<T> var1, String var2, Map<String, Object> var3);

  @DynamicResultType(isList = true)
  @SelectProvider(type = SProvider.class, method = "select")
  <T> List<T> selectAll(Class<T> var1, String var2, Map<String, Object> var3);

  @DynamicResultType(isList = true, paged = true)
  @SelectProvider(type = SProvider.class, method = "select")
  <T> PagedList<T> selectPage(Class<T> var1, String var2, Map<String, Object> var3);

  @DynamicResultType(isList = true, paged = true)
  @SelectProvider(type = SProvider.class, method = "sql")
  <T> PagedList<T> nativeSelectPage(Class<T> var1, String var2, Map<String, Object> var3);

  @DynamicResultType(isList = true)
  @SelectProvider(type = SProvider.class, method = "sql")
  <T> List<T> nativeSelectAll(Class<T> var1, String var2, Map<String, Object> var3);

  @UpdateProvider(type = SProvider.class, method = "nativeExecute")
  Integer nativeExecute(String var1, @Param("param3") Map<String, Object> var2);

  @InsertProvider(type = SProvider.class, method = "insertSql")
  Integer insert(String var1, Map<String, Object> var2);

  @UpdateProvider(type = SProvider.class, method = "update")
  Integer update(String var1, Map<String, Object> var2);

  @DeleteProvider(type = SProvider.class, method = "update")
  Integer delete(String var1, Map<String, Object> var2);
}
